<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */
namespace app\service\material;

use app\enum\CommonEnum;
use app\model\KsMaterialDailyReportModel;
use think\Model;

class KsMaterialCostService extends MaterialCostService implements MaterialService
{
    /**
     *
     * @param int $date 日期
     * @param int $num 脚本编号
     * @return bool|null
     */
    public static function getClientMaterialCost(int $date, int $num): ?bool
    {
        self::getMedia();
        self::setDate($date);
        self::setNum($num);
        self::setReportModel(new KsMaterialDailyReportModel());
        return self::setClientMaterialCost();
    }

    public static function setNum(int $num)
    {
        self::$runNum = $num;
    }

    public static function setDate(int $num = 0): bool
    {
        self::$runDate = $num;
        return true;
    }

    public static function getMedia(): int
    {
        self::$mediaId = CommonEnum::KS_MEDIA;
        return CommonEnum::KS_MEDIA;
    }

    /**
     * 数据报表模型.
     * @param Model $model 报表模型
     * @return bool
     */
    public static function setReportModel(Model $model): bool
    {
        self::$reportModel = $model;
        return true;
    }

}
